window.onload = function(){
	var fn= sessionStorage.getItem("function")
	if(fn === 'mypersonalcenterdiv'){
		$("#li-mypersonalcenter").click()
	}
	if(fn === 'evaluateorder'){
		$("#li-evaluateorder").click()
	}
	$("#allorder").click()
}
// /*------------------------------------------------个人中心菜单(开始) ------------------------*/
$(".personal-li").click(function(){
	$(".personal-li").css("color","#757575")
	$(this).css("color","orangered")
})
// 我的订单
$("#li-myorder").click(function(){
	$("#myorder").css("display","block")
	$("#evaluateorder").css("display","none")
	$("#mypersonalcenter").css("display","none")
	$("#Receivingaddress").css("display","none")
})
// 评价订单
$("#li-evaluateorder").click(function(){
	$("#myorder").css("display","none")
	$("#evaluateorder").css("display","block")
	$("#mypersonalcenter").css("display","none")
	$("#Receivingaddress").css("display","none")
})
//我的个人中心
$("#li-mypersonalcenter").click(function(){
	$("#myorder").css("display","none")
	$("#evaluateorder").css("display","none")
	$("#mypersonalcenter").css("display","block")
	$("#Receivingaddress").css("display","none")
})
//收货地址
$("#li-Receivingaddress").click(function(){
	$("#myorder").css("display","none")
	$("#evaluateorder").css("display","none")
	$("#mypersonalcenter").css("display","none")
	$("#Receivingaddress").css("display","block")
})
function SelectPayment(){
	$("#li-myorder").click()
	$("#payment").click()
}
function SelectGoods(){
	$("#li-myorder").click()
	$("#goods").click()
}
function SelectRecycle(){
	$("#li-evaluateorder").click()
}
function SelectMyOrder(){
	$("#li-myorder").click()
}
//个人信息
//修改密码
/*------------------------------------------------个人中心菜单(结束) ------------------------*/
$(".order-p").click(function(){
	$(".order-p").css("color","#757575")
	$(this).css("color","orangered")
})
// 所有订单
$("#allorder").click(function(){
	$("#orderallorder").css("display","block")
	$("#orderpayment").css("display","none")
	$("#ordergoods").css("display","none")
	$("#orderrecycle").css("display","none")
})
//待支付
$("#payment").click(function(){
	$("#orderallorder").css("display","none")
	$("#orderpayment").css("display","block")
	$("#ordergoods").css("display","none")
	$("#orderrecycle").css("display","none")
})
//待收货
$("#goods").click(function(){
	$("#orderallorder").css("display","none")
	$("#orderpayment").css("display","none")
	$("#ordergoods").css("display","block")
	$("#orderrecycle").css("display","none")
})
//订单回收
$("#recycle").click(function(){
	$("#orderallorder").css("display","none")
	$("#orderpayment").css("display","none")
	$("#ordergoods").css("display","none")
	$("#orderrecycle").css("display","block")
})
//添加收货地址模糊弹窗
$("#add-text").click(function(){
	$("#bodyone").css("position","absolute")
	$("#bodyone").css("left","0px")
	$("#bodyone").css("right","0px")
	$("#bodyone").css("top","0px")
	$("#bodyone").css("bottom","0px")
	$("#bodyone").css("filter","brightness(40%)")
	$("#bodyone").css("backgroundSize","cover")
	$("#ADDaddress").css("display","block")
})
$("#txt-address").click(function(){
	$("#addressDivOne").css("display","none")
	$("#addressDivTwo").css("display","block")
})
$("#esc").click(function(){
	$("#addressDivOne").css("display","block")
	$("#addressDivTwo").css("display","none")
})
//添加评价订单
function ADDevaluate(){
	$("#bodyone").css("position","absolute")
	$("#bodyone").css("left","0px")
	$("#bodyone").css("right","0px")
	$("#bodyone").css("top","0px")
	$("#bodyone").css("bottom","0px")
	$("#bodyone").css("filter","brightness(40%)")
	$("#bodyone").css("backgroundSize","cover")
	$("#ADDevaluate").css("display","block")
}
//退出模糊弹窗
function esc(){
	$("#bodyone").css("filter","brightness(100%)")
	$("#ADDaddress").css("display","none")
	$("#ADDevaluate").css("display","none")
	$("#addressDivOne").css("display","block")
	$("#addressDivTwo").css("display","none")
}
function AddAddress(){
	$("#add-text").click()
}
//获取当前时间进行判断：早、中、晚
now = new Date(),hour = now.getHours()
if (hour < 10){document.getElementById("time").innerText="早上好~"} 
else if (hour < 12){document.getElementById("time").innerText="中午好~"} 
else if (hour < 17){document.getElementById("time").innerText="下午好~"} 
else if (hour < 19){document.getElementById("time").innerText="傍晚好~"} 
else if (hour < 22){document.getElementById("time").innerText="晚上好~"} 
else {document.getElementById("time").innerText="夜里好~"} 
function Login(){
	location.href ="Login.html"; 
	sessionStorage.setItem("function","Login"); 
}
function Register(){
	location.href ="Login.html"; 
	sessionStorage.setItem("function","Register"); 
}
function AccountManagementLogin(){
	location.href='AccountManagement.html?account='+vm.account
	sessionStorage.setItem("function","Logindiv"); 
}
function AccountManagementPersonal(){
	location.href='AccountManagement.html?account='+vm.account
	sessionStorage.setItem("function","Personaldiv"); 
}